package com.dashboard.cloud.feign.controller;

import com.dashboard.cloud.common.dto.UserDTO;
import com.dashboard.cloud.feign.service.FeignClientService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * All rights Reserved, Designed By www.super-master.com
 *
 * @ProjectName: spring-cloud-dashboard
 * @Package: com.dashboard.cloud.feign.controller
 * @ClassName: FeignClientController
 * @Description: []
 * <p> </p>
 * @Author: [Lance Ting]
 * @Date: 2024/11/15 14:33
 * @Version: V1.0
 * @Copyright: 2024 www.super-master.com Inc. All rights reserved.
 * TODO: 注意,本文件Lance Ting所作,如果转载或使用请标明具体出处!
 **/
@RestController
@RequestMapping("/feign")
public class FeignClientController {
    @Resource
    private FeignClientService feignClientService;

    @GetMapping("/server/user/{userId}")
    public UserDTO verifyRemoteServer(@PathVariable("userId") Long userId) {
        return feignClientService.getUserById(userId);
    }
}